#include <iostream>
#include <fstream>
#include "ContextFreeGrammar_LR1.h"
#include "FirstFollowGenerator.h"
#include "OutputHelper.h"

using namespace std;

int main()
{
    ifstream infile("in_LR1.txt");
    ContextFreeGrammar_LR1 CFG(infile);


    cout << "Nonterminals:" ;
    CFG.PrintNonterminal();
    cout << endl << "Terminals:" ;
    CFG.PrintTerminal();
    cout << endl << "Productions:" << endl;
    CFG.PrintProduction();

    FirstFollowGenerator ffg(&CFG);
    ffg.Generate();
    CFG.AssignFirstFollow(&ffg);
    CFG.Test();


    return 0;
}
